node {
    def projectName = "eqxiu-ieditor-service"
    def projectVersion = "1.0.0"
    try {

        stage('Checkout') {
            checkout scm
        }
        
        stage('Java Build') {
//            sh "cd $JENKINS_HOME/.m2/repository/com/eqxiu/ieditor/eqxiu-ieditor-service-api/&& rm -rf *"
            sh "$JENKINS_HOME/tools/hudson.tasks.Maven_MavenInstallation/mvn-3.5.2/bin/mvn clean package -Pdevelop -Dmaven.test.skip=true"
            sh "unzip $projectName/target/*.zip -d $projectName/target/$projectName"
        }

        stage('Delivery') {
            docker.withRegistry('https://ccr.ccs.tencentyun.com', 'qcloud-docker-registry') {
                docker.build("ccr.ccs.tencentyun.com/eqxiu/$projectName:$projectVersion", "$projectName").push(projectVersion)
            }
        }
    } catch (e) {
        currentBuild.result = "FAILED"
        throw e
    } finally {

    }
}